package com.chezai.client.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.chezai.client.bean.TerminalBaseInfo;
import com.chezai.client.bean.ClassRecord;
import com.chezai.client.bean.PeriodRecord;
import com.chezai.client.bean.TerminalParameter;
import com.chezai.client.bean.UserInfo;
import com.chezai.client.bean.RandomPhoto;
import com.chezai.client.bean.CoachLoginRecord;
import com.chezai.client.bean.StudentStudyRecord;

import com.chezai.client.dao.TerminalBaseInfoDao;
import com.chezai.client.dao.ClassRecordDao;
import com.chezai.client.dao.PeriodRecordDao;
import com.chezai.client.dao.TerminalParameterDao;
import com.chezai.client.dao.UserInfoDao;
import com.chezai.client.dao.RandomPhotoDao;
import com.chezai.client.dao.CoachLoginRecordDao;
import com.chezai.client.dao.StudentStudyRecordDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig terminalBaseInfoDaoConfig;
    private final DaoConfig classRecordDaoConfig;
    private final DaoConfig periodRecordDaoConfig;
    private final DaoConfig terminalParameterDaoConfig;
    private final DaoConfig userInfoDaoConfig;
    private final DaoConfig randomPhotoDaoConfig;
    private final DaoConfig coachLoginRecordDaoConfig;
    private final DaoConfig studentStudyRecordDaoConfig;

    private final TerminalBaseInfoDao terminalBaseInfoDao;
    private final ClassRecordDao classRecordDao;
    private final PeriodRecordDao periodRecordDao;
    private final TerminalParameterDao terminalParameterDao;
    private final UserInfoDao userInfoDao;
    private final RandomPhotoDao randomPhotoDao;
    private final CoachLoginRecordDao coachLoginRecordDao;
    private final StudentStudyRecordDao studentStudyRecordDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        terminalBaseInfoDaoConfig = daoConfigMap.get(TerminalBaseInfoDao.class).clone();
        terminalBaseInfoDaoConfig.initIdentityScope(type);

        classRecordDaoConfig = daoConfigMap.get(ClassRecordDao.class).clone();
        classRecordDaoConfig.initIdentityScope(type);

        periodRecordDaoConfig = daoConfigMap.get(PeriodRecordDao.class).clone();
        periodRecordDaoConfig.initIdentityScope(type);

        terminalParameterDaoConfig = daoConfigMap.get(TerminalParameterDao.class).clone();
        terminalParameterDaoConfig.initIdentityScope(type);

        userInfoDaoConfig = daoConfigMap.get(UserInfoDao.class).clone();
        userInfoDaoConfig.initIdentityScope(type);

        randomPhotoDaoConfig = daoConfigMap.get(RandomPhotoDao.class).clone();
        randomPhotoDaoConfig.initIdentityScope(type);

        coachLoginRecordDaoConfig = daoConfigMap.get(CoachLoginRecordDao.class).clone();
        coachLoginRecordDaoConfig.initIdentityScope(type);

        studentStudyRecordDaoConfig = daoConfigMap.get(StudentStudyRecordDao.class).clone();
        studentStudyRecordDaoConfig.initIdentityScope(type);

        terminalBaseInfoDao = new TerminalBaseInfoDao(terminalBaseInfoDaoConfig, this);
        classRecordDao = new ClassRecordDao(classRecordDaoConfig, this);
        periodRecordDao = new PeriodRecordDao(periodRecordDaoConfig, this);
        terminalParameterDao = new TerminalParameterDao(terminalParameterDaoConfig, this);
        userInfoDao = new UserInfoDao(userInfoDaoConfig, this);
        randomPhotoDao = new RandomPhotoDao(randomPhotoDaoConfig, this);
        coachLoginRecordDao = new CoachLoginRecordDao(coachLoginRecordDaoConfig, this);
        studentStudyRecordDao = new StudentStudyRecordDao(studentStudyRecordDaoConfig, this);

        registerDao(TerminalBaseInfo.class, terminalBaseInfoDao);
        registerDao(ClassRecord.class, classRecordDao);
        registerDao(PeriodRecord.class, periodRecordDao);
        registerDao(TerminalParameter.class, terminalParameterDao);
        registerDao(UserInfo.class, userInfoDao);
        registerDao(RandomPhoto.class, randomPhotoDao);
        registerDao(CoachLoginRecord.class, coachLoginRecordDao);
        registerDao(StudentStudyRecord.class, studentStudyRecordDao);
    }
    
    public void clear() {
        terminalBaseInfoDaoConfig.clearIdentityScope();
        classRecordDaoConfig.clearIdentityScope();
        periodRecordDaoConfig.clearIdentityScope();
        terminalParameterDaoConfig.clearIdentityScope();
        userInfoDaoConfig.clearIdentityScope();
        randomPhotoDaoConfig.clearIdentityScope();
        coachLoginRecordDaoConfig.clearIdentityScope();
        studentStudyRecordDaoConfig.clearIdentityScope();
    }

    public TerminalBaseInfoDao getTerminalBaseInfoDao() {
        return terminalBaseInfoDao;
    }

    public ClassRecordDao getClassRecordDao() {
        return classRecordDao;
    }

    public PeriodRecordDao getPeriodRecordDao() {
        return periodRecordDao;
    }

    public TerminalParameterDao getTerminalParameterDao() {
        return terminalParameterDao;
    }

    public UserInfoDao getUserInfoDao() {
        return userInfoDao;
    }

    public RandomPhotoDao getRandomPhotoDao() {
        return randomPhotoDao;
    }

    public CoachLoginRecordDao getCoachLoginRecordDao() {
        return coachLoginRecordDao;
    }

    public StudentStudyRecordDao getStudentStudyRecordDao() {
        return studentStudyRecordDao;
    }

}
